The webserver in Pytigon isn't a single thing — it's a layered abstraction that adapts to its environment. Development on localhost? Production behind Nginx? Running inside a Docker container? Pytigon's server layer handles all of these without changing a single line of your application code.
Pytigon's server speaks multiple protocols simultaneously, each optimized for a different communication pattern:
Every Django view in Pytigon doubles as a REST endpoint. The generic table views automatically expose list, add, edit, and delete operations over HTTP. Add ?format=json to any list URL and you get machine-readable data instead of HTML tables.
Key endpoints follow this URL structure:
[app_name]/table/[TableName]/ → HTML table (list view)
[app_name]/table/[TableName]/list/ → AJAX list data
[app_name]/table/[TableName]/[id]/edit/ → Edit form
[app_name]/table/[TableName]/add/ → Add form
[app_name]/table/[TableName]/action/[action_name]/ → Custom actions
[app_name]/table/[TableName]/[id]/[target]/[view_type]/ → Complex view
Django Channels provides WebSocket support for real-time bidirectional communication. Pytigon extends this with:
consumers.pyFor applications that need fine-grained data fetching, Pytigon integrates GraphQL through Django's ObjectType system. Define your schema, and clients can request exactly the fields they need — no more, no less.
For integration with legacy systems, Pytigon exposes XML-RPC endpoints. Background tasks can be registered as RPC functions, callable from any XML-RPC client.
Pytigon includes a custom ASGI bridge (schhttptools.asgi_bridge) that enables communication between the desktop client and the embedded server. This bridge:
python manage.py runserver
The Django development server. Hot-reloading. Debug toolbar. All the nice things developers love. Plus Daphne for WebSocket support.
For production, Pytigon recommends:
Nginx → Gunicorn (WSGI) + Daphne (ASGI) → Django
Nginx handles: - Static file serving - SSL termination - Load balancing - Request buffering
Gunicorn handles WSGI (standard HTTP), and Daphne handles ASGI (WebSockets). Both point to the same Django application.
The AppImage and Docker container modes bundle everything — server, client components, and database connectors — into a single portable unit. Perfect for development environments and small-scale deployments where the overhead of a full production setup isn't justified.
The server doesn't just serve web pages. It generates:
schhtml rendering engine, converting .ihtml templates to pixel-perfect PDFsEach output format uses a different device context (basedc, pdfdc, xlsxdc, etc.) but the same template and rendering pipeline.
Pytigon layers on top of Django's auth system:
filter_by_permissions() to restrict which rows a user can see.ihtml → .html templates are cachedselect_related and prefetch_related where possible